import { CollapsedState } from "../types";
const state: CollapsedState = {
  sidebar: {
    opened: false,
    withoutAnimation: false,
    theme: "dark",
  },
};
const mutations = {
  TOGGLE_SIDEBAR: (state: CollapsedState, opened: boolean) => {
    state.sidebar.opened = opened;
  },
  SET_THEME: (state: CollapsedState, theme: string) => {
    state.sidebar.theme = theme;
  },
};
const actions = {
  toggleSideBar(context: any, opened: boolean) {
    context.commit("TOGGLE_SIDEBAR", opened);
  },
  setTheme(context: any, theme: string) {
    context.commit("SET_THEME", theme);
  },
};

export default {
  namespaced: true,
  state,
  mutations,
  actions,
};
